package com.lb.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @version 1.0
 * @Author: Edward
 * @Date: 2021/5/12 17:00
 * @Description:
 */
public class CombUtils {

    public static List<String> stack = new ArrayList<>();
//    public static List<Stack<String>> stacks = Lists.newArrayList();

    public static void f(List<String> shu, List<List<String>> stacks, int targ, int has, int cur) {
        if(has == targ) {
            List<String> stack2 = stack;
//            System.out.println(stack);
//            BeanUtils.copyProperties(stack, stack2);
            stacks.add(stack2);
        }

        for(int i=cur;i<shu.size();i++) {
            if(!stack.contains(shu.get(i))) {
                stack.add(shu.get(i));
                f(shu, stacks, targ,has+1, i);
                stack.remove(shu.get(i));
            }
        }
    }
}
